
with open("cet4.txt","rb") as f:
    txt = str(f.read())
    res = txt.split(" ")
    word = []
    for i in range(len(res)):
        res[i] = res[i].replace(",", "").replace("\\r", "").replace("\\xef\\xbc\\x8c","")
        if "\\n" in res[i]:
            tmp = res[i].split("\\n")
            word.append(tmp[0])
            word.append(tmp[1])
            continue

        if res[i] != "":

            word.append(res[i])


    output = word[1:]
    str = ""
    for i in range(len(output)):
        output[i] = output[i].replace(r"\xef\xbc\x9", "").replace("...", "").replace(r"\t", "")
        if output[i] != "":
            str += output[i] + ","
            print(output[i])
            r'''
            \xef\xbc\x9
            ...
            \t -> ,
            ' -> "
            '''
    with open("cet4-res.txt", "w+") as f:
        f.write(str)
    print(word[1:])



